package sc.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: wesleyOne
 * @Email: wesleyone666@163.com
 * @Gitee: https://gitee.com/wesleyOne
 * @Date: 2020/8/26
 */
@Configuration
public class ApplicationContextConfig {

    /**
     * @LoadBalanced赋予RestTemplate负载均衡的能力
     * @return
     */
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
